/**
 * Created by Administrator on 2018/1/17.
 */
var img=document.getElementsByClassName("img");
var img2=document.getElementById("row-div").children[0];
var t=1;
for(var i= 0;i<img.length;i++){
    img[i].onclick=function(){
        img2.src="images/"+this.id.substr(3,1)+".jpg";
        for(var j=0;j<img.length;j++){
            img[j].style.border="";
            this.style.border="3px solid cornflowerblue";
        }
    }
}
function move(){
    if (t + 1>5){
        t = 1;
        img2.src="images/"+t+".jpg";
    } else {
        t = t + 1;
        img2.src="images/"+t+".jpg";
    }
}
var timer = setInterval(move,3000);
